package org.si.graphics;

import java.awt.Component;
import java.awt.Paint;

/**
 * Provide a Paint instance. This can be used in cases where a Paint class is required but where it can be possible for
 * the paint to be variable with the size of the target area or the Component that is painting it.
 *
 * For example you could use a subclass of this interface to implement a GradientPaint that goes from the top left to
 * bottom right of the target area always, or a Paint that always paints the background colour of the given component.
 *
 * @author Matt Nathan
 */
public interface PaintProvider {

    /**
     * Get a paint instance that can fill the given area.
     *
     * @param c      The component that can be used to get paint information.
     * @param x      The x coord to paint to.
     * @param y      The y coord to paint to.
     * @param width  The width of the area to paint to.
     * @param height The height of the area to paint to.
     * @return The Paint instance to use for painting.
     */
    Paint get(Component c, int x, int y, int width, int height);
}
